package com.xayy.scheduled.mapper;

import cn.kawins.mybatis.BaseMapper;

import com.xayy.scheduled.model.DataInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;


/**
* @ClassName: DataInfoMapper
* @Description: 数据访问接口
* @author liuyuan
* @date 2025-06-27
*/
@Mapper
@Repository
public interface DataInfoMapper extends BaseMapper<DataInfo> {
    @Select("" +
            "SELECT * FROM HEALTH_XW.data_info a WHERE 1=1   " +
            "AND a.data_code=#{dataCode} limit 1; ")
    DataInfo selectByCode(@Param("dataCode") String dataCode);

    @Insert("INSERT INTO HEALTH_XW.data_info (data_name, data_code, http_addr) " +
            "VALUES (#{dataName}, #{dataCode}, #{httpAddr})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(DataInfo dataInfo);
}

